
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../static/img/favicons/favicon.ico">

    <title>Signin Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="../static/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="../static/css/signin.css" rel="stylesheet">
    <script>
      function fun(){
        var txt = document.getElementById("province").value;
        console.log(txt)
        var cityDict = {
          "gd": ["广州", "深圳"],
          "hn": ["海口", "三亚"]
        }

        var cites = cityDict[txt];
        console.log(cites)
        var cityBox = document.getElementById("city")
        for(let i=0; i<cites.length; i++){
          cityBox.options[i] = new Option(cites[i], i);
        }
      }
    </script>
  </head>

  <body class="text-center">
    <form class="form-signin">
      <img class="mb-4" src="../static/img/bootstrap-solid.svg" alt="" width="72" height="72">
      <h1 class="h3 mb-3 font-weight-normal">Please sign in</h1>
      <div class="dropdown">
        <select id="province" onchange="fun()">
          <option value="gd">广东</option>
          <option value="hn">海南</option>
          <option value="opel">Opel</option>
          <option value="audi">Audi</option>
        </select>
      </div>

      <div class="dropdown">
        <select id="city">
          <option value="gd">广州</option>
          <option value="hn">深圳</option>
        </select>
      </div>
      <div class="checkbox mb-3">
        <label>
          <input type="checkbox" value="remember-me"> Remember me
        </label>
      </div>
      <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
      <p class="mt-5 mb-3 text-muted">&copy; 2017-2018</p>
    </form>
  </body>
</html>
